<template>
	<view class="flex-col page">
		<view class="flex-col group_1">
			<view class="flex-col group_2">
				<view class="flex-col section_1">
					<text class="text_1">咨询师简介范例</text>
					<!-- <view class="flex-col items-center text-wrapper"><text class="text_2">更换一个</text></view> -->
					<view class="group_3">
						<text class="text_3">某品牌─培训总监</text>
						<p></p>
						<text class="text_4">18年以上的咨询师管理经验</text>
						<p></p>
						<text class="text_5">曾负责80+以上门店的经营管理</text>
						<p></p>
						<text class="text_6">曾担任好伦哥、咨询师、东道联盟多家连锁企业的区域经理、营运经理和培训经理</text>
					</view>
				</view>
				<view class="justify-between group_22">
					<text class="text_21">个人简介</text>
					<view class="flex-row">
						<!-- <input class="text_3" v-model="form.personAbout" placeholder="请输入您的个人简历" /> -->
						<!-- <text class="text_22">点击编辑个人简介</text>
				<image
					src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558031946872275143.png"
					class="image_5 image_14" /> -->
					</view>
				</view>
				<!-- <uni-easyinput class="txt_word"  type="textarea" v-model="form.personAbout" placeholder="我是第一行\n我是第二行\n我是第三行">
		</uni-easyinput> -->
				<textarea class="txt_word" v-model="personAbout" placeholder=" "></textarea>
				<!-- <view class="flex-col items-start text-wrapper_1"><text class="text_7">请输入您的个人简介</text></view> -->
			</view>
			<view class="flex-col items-center button" @click="go"><text class="text_8">完成</text></view>
		</view>
	</view>
</template>

<script>
	import {
		getUserInfo
	} from '../../api/api.js'
	import {
		editUser
	} from '../../api/index.js'
	export default {
		components: {},
		onLoad(option) {
			console.log(option.id)
			this.id = option.id
			this.personAbout = option.context
		},
		data() {
			return {
				personAbout: '',
				id: "",
				status:false,
				info:{
					userId: this.$store.state.userInfo.wxInfo.uid
				}
			}
		},
		mounted() {
			getUserInfo(this.id).then(res => {
				this.status = true
				this.personAbout = res.data.info.descInfo
			}).catch(res => {
				console.log("失败")
			});
		},
		methods: {
			go() {
				if (!this.personAbout) {
					uni.showToast({
						title: '输入不能为空！',
						icon: 'none'
					})
					return
				}
				if(this.status){
					this.info.descInfo = this.personAbout
					editUser(this.info).then(res=>{
						console.log(res)
					})
				}else{
					uni.$emit('updateData', this.personAbout)
					
				}
				uni.navigateBack({
					delta: 1
				});
				
			}
		},
	};
</script>

<style scoped lang="css">
	.page {
		background-color: #fff;
		border-bottom: solid 0.28rem #ffffff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.group_1 {
		padding: 0 0.91rem 2.72rem 0.94rem;
		flex: 1 1 auto;
		overflow-y: auto;
	}

	.group_2 {
		padding: 0.94rem 0;
	}

	.button {
		margin-top: 1.47rem;
		padding: 0.91rem 0 0.88rem;
		background-color: #1989E1;
		border-radius: 1.31rem;
	}

	.section_1 {
		padding: 0.84rem 0.28rem 0.88rem 0.63rem;
		border-radius: 0.47rem;
		background-size: 100% 100%;
		background-repeat: no-repeat;
		position: relative;
	}

	.text-wrapper_1 {
		margin-top: 0.94rem;
		padding: 0.91rem 0 18.59rem;
		background-color: #ffffff;
		border-radius: 0.47rem;
	}

	.text_8 {
		color: #ffffff;
		font-size: 0.88rem;
		font-family: SourceHanSansCN;
		font-weight: 500;
		line-height: 0.84rem;
	}

	.txt_word {
		width: 90%;
		margin-left: 5%;
		background-color: #f5f5f5;
	}

	.text_1 {
		align-self: flex-start;
		color: #1989E1;
		font-size: 0.94rem;
		font-family: SourceHanSansCN;
		font-weight: 500;
		line-height: 0.91rem;
	}

	.text-wrapper {
		padding: 0.38rem 0;
		background-color: #1989E1;
		border-radius: 0.7rem;
		width: 3.97rem;
		position: absolute;
		right: 0.66rem;
		top: 0.63rem;
	}

	.group_3 {
		margin-top: 0.72rem;
		line-height: 1.13rem;
		position: relative;
	}

	.text_7 {
		margin-left: 0.94rem;
		color: #bfbfbf;
		font-size: 0.75rem;
		font-family: SourceHanSansCN;
		line-height: 0.72rem;
	}

	.text_2 {
		color: #ffffff;
		font-size: 0.69rem;
		font-family: SourceHanSansCN;
		line-height: 0.66rem;
	}

	.text_3 {
		color: #333333;
		font-size: 0.69rem;
		font-family: SourceHanSansCN;
		line-height: 1.13rem;
	}

	.text_4 {
		color: #333333;
		font-size: 0.69rem;
		font-family: SourceHanSansCN;
		line-height: 1.13rem;
	}

	.group_22 {
		padding: 0.88rem 0 0.91rem;
		border-bottom: solid 0.031rem #e5e5e5;
	}

	.text_21 {
		margin-bottom: 0.094rem;
		color: #666666;
		font-size: 0.81rem;
		font-family: SourceHanSansCN;
		line-height: 0.75rem;
	}

	.text_5 {
		color: #333333;
		font-size: 0.69rem;
		font-family: SourceHanSansCN;
		line-height: 1.13rem;
	}

	.text_6 {
		color: #333333;
		font-size: 0.69rem;
		font-family: SourceHanSansCN;
		line-height: 1.13rem;
	}
</style>
